<div class="max-w-md mx-auto px-2 mt-12 mb-4">
  <div class="space-y-6 mx-auto">
    <div class="space-y-6">
      <div class="flex items-center justify-center">
        <%= render 'start_form/banner' %>
      </div>
      <div class="flex items-center bg-base-200 rounded-xl p-4 mb-4">
        <div class="flex items-center">
          <div class="mr-3">
            <%= svg_icon('writing_sign', class: 'w-10 h-10') %>
          </div>
          <div>
            <p class="text-lg font-bold mb-1"><%= @submitter.submission.template.name %></p>
            <p class="text-sm">Signed on <%= l(@submitter.completed_at.to_date, format: :long, locale: @submitter.submission.template.account.locale) %></p>
          </div>
        </div>
      </div>
    </div>
    <div>
      <% if Accounts.can_send_emails?(@submitter.submission.template.account) && @submitter.email.present? %>
        <%= button_to button_title(title: 'Send copy to Email', disabled_with: 'Sending', icon: svg_icon('mail_forward', class: 'w-6 h-6')), send_submission_email_index_path, params: { submitter_slug: @submitter.slug }, form: { onsubmit: 'event.submitter.disabled = true' }, class: 'white-button w-full' %>
        <% if @submitter.submission.template.submitters.size != 1 %>
          <div class="divider">OR</div>
        <% else %>
          <div class="py-2"></div>
        <% end %>
      <% end %>
      <download-button data-src="<%= submitter_download_index_path(@submitter.slug) %>" class="base-button w-full">
        <span class="flex items-center justify-center space-x-2" data-target="download-button.defaultButton">
          <%= svg_icon('download', class: 'w-6 h-6') %>
          <span>Download documents</span>
        </span>
        <span class="flex items-center justify-center space-x-2 hidden" data-target="download-button.loadingButton">
          <%= svg_icon('loader', class: 'w-6 h-6 animate-spin') %>
          <span>Downloading</span>
        </span>
      </download-button>
    </div>
    <% if @submitter.submission.template.submitters.size == 1 %>
      <div class="divider">OR</div>
      <div>
        <%= button_to button_title(title: 'Resubmit', disabled_with: 'Resubmit', icon: svg_icon('reload', class: 'w-6 h-6')), start_form_path(@submitter.submission.template.slug), params: { submitter: { email: @submitter.email, phone: @submitter.phone, name: @submitter.name }, resubmit: true }, method: :put, form: { onsubmit: 'event.submitter.disabled = true' }, class: 'white-button w-full' %>
      </div>
    <% end %>
  </div>
</div>
<%= render 'shared/attribution', link_path: '/start' %>
